﻿namespace VAdvantage.Model
{

    /** Generated Model - DO NOT CHANGE */
    using System;
    using System.Text;
    using VAdvantage.DataBase;
    using VAdvantage.Common;
    using VAdvantage.Classes;
    using VAdvantage.Process;
    using VAdvantage.Model;
    using VAdvantage.Utility;
    using System.Data;
    /** Generated Model for VSS_TBarCode
     *  @author Jagmohan Bhatt (generated) 
     *  @version Vienna Framework 1.1.1 - $Id$ */
    public class X_VSS_TBarCode : PO
    {
        public X_VSS_TBarCode(Context ctx, int VSS_TBarCode_ID, String trxName)
            : base(ctx, VSS_TBarCode_ID, trxName)
        {
            /** if (VSS_TBarCode_ID == 0)
            {
            SetVSS_TBARCODE_ID (0);
            }
             */
        }
        public X_VSS_TBarCode(Ctx ctx, int VSS_TBarCode_ID, String trxName)
            : base(ctx, VSS_TBarCode_ID, trxName)
        {
            /** if (VSS_TBarCode_ID == 0)
            {
            SetVSS_TBARCODE_ID (0);
            }
             */
        }
        /** Load Constructor 
        @param ctx context
        @param rs result set 
        @param trxName transaction
        */
        public X_VSS_TBarCode(Context ctx, DataRow rs, String trxName)
            : base(ctx, rs, trxName)
        {
        }
        /** Load Constructor 
        @param ctx context
        @param rs result set 
        @param trxName transaction
        */
        public X_VSS_TBarCode(Ctx ctx, DataRow rs, String trxName)
            : base(ctx, rs, trxName)
        {
        }
        /** Load Constructor 
        @param ctx context
        @param rs result set 
        @param trxName transaction
        */
        public X_VSS_TBarCode(Ctx ctx, IDataReader dr, String trxName)
            : base(ctx, dr, trxName)
        {
        }
        /** Static Constructor 
         Set Table ID By Table Name
         added by ->Harwinder */
        static X_VSS_TBarCode()
        {
            Table_ID = Get_Table_ID(Table_Name);
            model = new KeyNamePair(Table_ID, Table_Name);
        }
        /** Serial Version No */
        static long serialVersionUID = 27563458224393L;
        /** Last Updated Timestamp 8/9/2010 11:18:27 AM */
        public static long updatedMS = 1281332907604L;
        /** AD_Table_ID=1000149 */
        public static int Table_ID;
        // =1000149;

        /** TableName=VSS_TBarCode */
        public static String Table_Name = "VSS_TBarCode";

        protected static KeyNamePair model;
        protected Decimal accessLevel = new Decimal(3);
        /** AccessLevel
        @return 3 - Client - Org 
        */
        protected override int Get_AccessLevel()
        {
            return Convert.ToInt32(accessLevel.ToString());
        }
        /** Load Meta Data
        @param ctx context
        @return PO Info
        */
        protected override POInfo InitPO(Context ctx)
        {
            POInfo poi = POInfo.GetPOInfo(ctx, Table_ID);
            return poi;
        }
        /** Load Meta Data
        @param ctx context
        @return PO Info
        */
        protected override POInfo InitPO(Ctx ctx)
        {
            POInfo poi = POInfo.GetPOInfo(ctx, Table_ID);
            return poi;
        }
        /** Info
        @return info
        */
        public override String ToString()
        {
            StringBuilder sb = new StringBuilder("X_VSS_TBarCode[").Append(Get_ID()).Append("]");
            return sb.ToString();
        }
        /** Set IP Address.
        @param IP_Address Defines the IP address to transfer data to */
        public void SetIP_Address(String IP_Address)
        {
            if (IP_Address != null && IP_Address.Length > 40)
            {
                log.Warning("Length > 40 - truncated");
                IP_Address = IP_Address.Substring(0, 40);
            }
            Set_Value("IP_Address", IP_Address);
        }
        /** Get IP Address.
        @return Defines the IP address to transfer data to */
        public String GetIP_Address()
        {
            return (String)Get_Value("IP_Address");
        }
        /** Set PRODKEY.
        @param PRODKEY PRODKEY */
        public void SetPRODKEY(String PRODKEY)
        {
            if (PRODKEY != null && PRODKEY.Length > 60)
            {
                log.Warning("Length > 60 - truncated");
                PRODKEY = PRODKEY.Substring(0, 60);
            }
            Set_Value("PRODKEY", PRODKEY);
        }
        /** Get PRODKEY.
        @return PRODKEY */
        public String GetPRODKEY()
        {
            return (String)Get_Value("PRODKEY");
        }
        /** Set PRODNAME.
        @param PRODNAME PRODNAME */
        public void SetPRODNAME(String PRODNAME)
        {
            if (PRODNAME != null && PRODNAME.Length > 60)
            {
                log.Warning("Length > 60 - truncated");
                PRODNAME = PRODNAME.Substring(0, 60);
            }
            Set_Value("PRODNAME", PRODNAME);
        }
        /** Get PRODNAME.
        @return PRODNAME */
        public String GetPRODNAME()
        {
            return (String)Get_Value("PRODNAME");
        }
        /** Set PRODUPC.
        @param PRODUPC PRODUPC */
        public void SetPRODUPC(String PRODUPC)
        {
            if (PRODUPC != null && PRODUPC.Length > 60)
            {
                log.Warning("Length > 60 - truncated");
                PRODUPC = PRODUPC.Substring(0, 60);
            }
            Set_Value("PRODUPC", PRODUPC);
        }
        /** Get PRODUPC.
        @return PRODUPC */
        public String GetPRODUPC()
        {
            return (String)Get_Value("PRODUPC");
        }
        /** Set VSS_TBARCODE_ID.
        @param VSS_TBARCODE_ID VSS_TBARCODE_ID */
        public void SetVSS_TBARCODE_ID(int VSS_TBARCODE_ID)
        {
            if (VSS_TBARCODE_ID < 1) throw new ArgumentException("VSS_TBARCODE_ID is mandatory.");
            Set_ValueNoCheck("VSS_TBARCODE_ID", VSS_TBARCODE_ID);
        }
        /** Get VSS_TBARCODE_ID.
        @return VSS_TBARCODE_ID */
        public int GetVSS_TBARCODE_ID()
        {
            Object ii = Get_Value("VSS_TBARCODE_ID");
            if (ii == null) return 0;
            return Convert.ToInt32(ii);
        }
    }

}
